<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

if ( ! function_exists('writer_link'))
{
	function writer_link($article)
	{

		return '<a href="' . site_url('profile/' . $article->iduser) . '">' .
					$article->signature . '</a>';
	}
}

if ( ! function_exists('score_info'))
{
	function score_info($article)
	{
		if(isset($article->relevance))
		{
			return 'Score: ' . $article->score .
					', target relevance: ' . $article->relevance;
		}
		else
		{
			return '';
		}
	}
}
////////////////////////////////////////////////////////////////////////////////
// Following are article viewing functions. They all take first parameter an
// object of class oxarticle, which needs to be loaded prior to calling these
// functions. Other parameters are view parameters, deciding what is shown and 
// what is a link and to where
/*
if ( ! function_exists('article_info'))
{
	function article_info($article, $relevance = false, $show_signature_as_title_by_signature = true,
            $show_score_and_flah_bar = true, $show_timestamp = true, $show_geostamp = true)
	{
        
    }
}


if ( ! function_exists('article_preview'))
{
	function article_preview($article, $show_signature = true)
	{
		$text = '<div class="article_preview" style="margin-top: 12px;">'.
				($show_signature?'<div class="article_preview_signature">'.writer_link($article).'</div>':'').
				'<div class="article_preview_stamp">'.score_info($article).'</div>'.
				'<h1>'.article_title_link($article).'</h1>'.
				'<p>'.$article->abstract.'</p>'.
				'</div>';
		return $text;		
	}
}
*/
if ( ! function_exists('article_title_link'))
{
	function article_title_link($article)
	{
		return '<a href="' . site_url('article/' . $article->idarticle) . '">' .
					$article->title . '</a>';
	}
}

if ( ! function_exists('flag_link'))
{
	function flag_link($flagname)
	{

		return '<a href="' . site_url('article/' . $article->idarticle) . '">' .
					$article->title . '</a>';
	}
}